登录 白背景

leetcode/100-n/342. 4的幂.md

https://leetcode-cn.com/problems/power-of-four/

class Solution {
    public boolean isPowerOfFour(int n) {
        if(n == 1){
            return true;
        }
        if(n > 0 && (n&3) == 0){
            return isPowerOfFour(n >>> 2);
        }
        if(n < 0 && (n&15) == 0){
            return isPowerOfFour(n >>> 4);
        }
        return false;
    }
}